home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
050
/
madtrb4.arc
/
SAFEWRIT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-11-30
|
1KB
|
38 lines
{@@@@@@@@@@@ copyright (C) 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@@@@
The purchaser of these procedures and functions may include them in COMPILED
programs freely, but may not sell or give away the source text.
driver for procedure SAFEWRITE--writes any file to screen even if it contains
control characters. Input a filename (try with .COM and .EXE files), output
to screen a "safe" version of that file.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
type
old_filename_type = string[14]; {This type declaration is NOT inside the
INCLUDE file in order to avoid multiple
declarations}
filename_type = string[14];
{$I existfil.lib}
{$I safewrit.lib}
var
File_to_show : filename_type;
File_itself : file of byte;
one_byte : byte;
begin
Write('Enter name of file: ');
Read(file_to_show);
ClrScr;
if exists(file_to_show) then
begin
Assign(file_itself,file_to_show);
reset(file_itself);
while not EOF(file_itself) do
begin
read(file_itself,one_byte);
safeWrite(one_byte);
end;
close(file_itself);
end
else WriteLn(file_to_show,' does not exist.');
end.